package com.frogs.ucenter.v1.request;

import javax.servlet.http.HttpServletRequest;

import com.frogs.framework.web.HttpRequestInfo;
import com.frogs.system.util.ApiUrlParamEnum;
import com.frogs.system.web.api.request.Request;
import com.frogs.system.web.exception.RequestIllegalException;

public class UserPointRegQueryRequest extends Request {
	
	private int applicablePlatformId;
	private String upRuleCode;
	private int upRuleStatus;
	
	public UserPointRegQueryRequest() {
	}
	
	@Override
	public void parse(HttpServletRequest request) {
		HttpRequestInfo requestInfo = new HttpRequestInfo(request);
		this.applicablePlatformId = requestInfo.getIntParameter(ApiUrlParamEnum.userId.getParamName(), -1);
		this.upRuleStatus = requestInfo.getIntParameter(ApiUrlParamEnum.upRuleStatus.getParamName(), -1);
		this.upRuleCode = requestInfo.getParameter(ApiUrlParamEnum.upRuleCode.getParamName(), null);
		
		if(applicablePlatformId < 0) {
			throw new RequestIllegalException("缺少适用平台id，请确认!");
		}
		
		if(upRuleCode == null) {
			throw new RequestIllegalException("缺少积分规则编号，请确认!");
		}
	}

	public int getApplicablePlatformId() {
		return applicablePlatformId;
	}

	public void setApplicablePlatformId(int applicablePlatformId) {
		this.applicablePlatformId = applicablePlatformId;
	}

	public String getUpRuleCode() {
		return upRuleCode;
	}

	public void setUpRuleCode(String upRuleCode) {
		this.upRuleCode = upRuleCode;
	}

	public int getUpRuleStatus() {
		return upRuleStatus;
	}

	public void setUpRuleStatus(int upRuleStatus) {
		this.upRuleStatus = upRuleStatus;
	}
	

}
